Skip to content

fix(core): Drop empty batches before they reach downstream buffers#25489

Merged
graphcareful merged 6 commits into
vectordotdev:masterfrom
graphcareful:rob/drop-empty-batches
May 26, 2026
Merged

fix(core): Drop empty batches before they reach downstream buffers#25489
graphcareful merged 6 commits into
vectordotdev:masterfrom
graphcareful:rob/drop-empty-batches

Conversation

@graphcareful

@graphcareful graphcareful commented May 22, 2026

Copy link
Copy Markdown
Contributor

Summary

This change drops empty batches in the fanout before they reach downstream buffers. This error is classified as a programmer error, and it can only happen if there is a bug in a transform (or source) which emits an empty batch into the pipeline.

However with disk buffering enabled if this bug does arise Vector crashes. This change drop the batch and logs, when in debug mode an assertion is instead raised.

How did you test this PR?

Additional unit tests

Change Type

  • Bug fix
  • New feature
  • Dependencies
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on our guidelines.
  • No. A maintainer will apply the no-changelog label to this PR.

References

Notes

  • Please read our Vector contributor resources.
  • Do not hesitate to use @vectordotdev/vector to reach out to us regarding this PR.
  • Some CI checks run only after we manually approve them.
    • We recommend adding a pre-push hook, please see this template.
    • Alternatively, we recommend running the following locally before pushing to the remote branch:
      • make fmt
      • make check-clippy (if there are failures it's possible some of them can be fixed with make clippy-fix)
      • make test
  • After a review is requested, please avoid force pushes to help us review incrementally.
    • Feel free to push as many commits as you want. They will be squashed into one before merging.
    • For example, you can run git merge origin master and git push.
  • If this PR introduces changes Vector dependencies (modifies Cargo.lock), please
    run make build-licenses to regenerate the license inventory and commit the changes (if any). More details on the dd-rust-license-tool.

@graphcareful graphcareful requested a review from a team as a code owner May 22, 2026 18:00
@github-actions github-actions Bot added domain: topology Anything related to Vector's topology code domain: core Anything related to core crates i.e. vector-core, core-common, etc labels May 22, 2026
@graphcareful graphcareful requested review from bruceg and pront May 22, 2026 18:00

@bruceg bruceg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me.

Comment thread lib/vector-core/src/fanout.rs Outdated
@graphcareful graphcareful changed the title fix(fanout): Drop empty batches before they reach downstream buffers fix(transform): Drop empty batches before they reach downstream buffers May 22, 2026
@graphcareful graphcareful enabled auto-merge May 22, 2026 20:56
@graphcareful graphcareful changed the title fix(transform): Drop empty batches before they reach downstream buffers fix(core): Drop empty batches before they reach downstream buffers May 22, 2026
@graphcareful graphcareful force-pushed the rob/drop-empty-batches branch from c2c2927 to cf685dd Compare May 26, 2026 13:38
@graphcareful

Copy link
Copy Markdown
Contributor Author

Changes in force-push

  • Rebased against main

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cf685dd3e2

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread lib/vector-core/src/fanout.rs
@pront pront disabled auto-merge May 26, 2026 13:55
Comment thread changelog.d/drop_empty_batches_fanout.fix.md Outdated
Comment thread lib/vector-core/src/fanout.rs Outdated
Comment thread lib/vector-core/src/fanout.rs
graphcareful and others added 2 commits May 26, 2026 09:55
Co-authored-by: Pavlos Rontidis <pavlos.rontidis@gmail.com>
Co-authored-by: Pavlos Rontidis <pavlos.rontidis@gmail.com>
@graphcareful graphcareful added this pull request to the merge queue May 26, 2026
Merged via the queue into vectordotdev:master with commit 5027cd6 May 26, 2026
58 checks passed
@graphcareful graphcareful deleted the rob/drop-empty-batches branch May 26, 2026 15:18
@github-actions github-actions Bot locked and limited conversation to collaborators May 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

domain: core Anything related to core crates i.e. vector-core, core-common, etc domain: topology Anything related to Vector's topology code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants